<template>
  <div class="person">
    <h2>当前求和为:{{ sum }}，放大10倍为:{{ bigSum }}</h2>
    <button @click="add">sum+1</button>
    <hr />
    <img v-for="(dog, index) in dogList" :src="dog" :key="index" />
    <br />
    <button @click="getLog">再来一只狗</button>
  </div>
</template>

<script lang="ts" setup>
import useSum from '@/hooks/useSum'
import useDog from '@/hooks/useDog'

// 引入封装的对象
const { sum, add, bigSum } = useSum()
const { dogList, getLog } = useDog()
</script>

<style scoped>
.person {
  background-color: skyblue;
  box-shadow: 0 0 10px;
  border-radius: 10px;
  padding: 10px;
}
button {
  margin: 5px 5px;
}
img {
  height: 200px;
  margin: 0 5px 0 0;
}
</style>
